package com.atguigu;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void main(String[] args) {
        //TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
        // to see how IntelliJ IDEA suggests fixing it.
        Student s1 = new Student("zhengtao",26);
        System.out.println(s1);

        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("bean1.xml");
//        Student student =(Student) context.getBean("student");
//        System.out.println(student);

        Student student2 =(Student) context.getBean("student2");
        System.out.println(student2);
        context.close();
    }
}